home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
By the Book
/
Learn C++ (CodeWarrior)
/
Chap 04.05 - overload
/
overload.cp
< prev
next >
Wrap
Text File
|
1995-10-20
|
529b
|
33 lines
#include <iostream.h>
void Display( short shortParam );
void Display( long longParam );
void Display( char *text );
int main()
{
short myShort = 3;
long myLong = 12345678L;
char *text = "Make it so...";
Display( myShort );
Display( myLong );
Display( text );
return 0;
}
void Display( short shortParam )
{
cout << "The short is: " << shortParam << "\n";
}
void Display( long longParam )
{
cout << "The long is: " << longParam << "\n";
}
void Display( char *text )
{
cout << "The text is: " << text << "\n";
}